﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GrewalCRM.Entities;

namespace GrewalCRM.Entities
{
  public class SMSFailure : BaseEntitiesGrewalCRM
  {
    #region Members   
    private int _CallID;
    private DateTime _SMSSendDate;    
    private string _RecipientType;
    private string _RecipientName;
    private string _RecipientMobile;
    private string _RecipientSMS;
    private string _ResponseCode;
    

    #endregion

    #region Constructors
    /// <summary>
    /// Create a new instance using the default constructor
    /// </summary>
    public SMSFailure():base()
    {      
    }

    /// <summary> 
    /// Create a new object using the minimum required information (all not-null fields except 
    /// auto-generated primary keys). 
    /// </summary> 
    public SMSFailure(int CallID, DateTime SMSSendDate, string RecipientType, string RecipientName, string RecipientMobile, string RecipientSMS, string ResponseCode)      
    {    
        this._CallID = CallID;
        this._SMSSendDate = SMSSendDate;    
        this._RecipientType = RecipientType;
        this._RecipientName= RecipientName;
        this._RecipientMobile = RecipientMobile;
        this._RecipientSMS = RecipientSMS;
        this._ResponseCode = ResponseCode;
        
    }


    /// <summary> 
    /// Create an object from an existing row of data with only ID feild 
    /// </summary> 
    public SMSFailure(int SMSFailureID)
      : base(SMSFailureID, null, null)
    {
      
    }

    /// <summary> 
    /// Create an object from an existing row of data. This will be used by Gentle to 
    /// construct objects from retrieved rows. 
    /// </summary> 
    public SMSFailure(int SMSFailureID, int CallID, DateTime SMSSendDate, string RecipientType, string RecipientName, string RecipientMobile, string RecipientSMS, string ResponseCode)
      : base(SMSFailureID, null, null)
    {
        this._CallID = CallID;
        this._SMSSendDate = SMSSendDate;
        this._RecipientType = RecipientType;
        this._RecipientName = RecipientName;
        this._RecipientMobile = RecipientMobile;
        this._RecipientSMS = RecipientSMS;
        this._ResponseCode = ResponseCode;
    }
    #endregion

    #region Public Properties    
    /// <summary>
    /// Property relating to database column CallID
    /// </summary>   
    public int CallID
    {
        get { return _CallID; }
        set { IsChanged |= _CallID != value; _CallID = value; }
    }

    /// <summary>
    /// Property relating to database column SMSSendDate
    /// </summary>    
    public DateTime SMSSendDate
    {
        get { return _SMSSendDate; }
      set { IsChanged |= _SMSSendDate != value; _SMSSendDate = value; }
    }

    /// <summary>
    /// Property relating to database column RecipientName
    /// </summary>    
    public string RecipientName
    {
        get { return _RecipientName != null ? _RecipientName.TrimEnd() : string.Empty; }
        set { IsChanged |= _RecipientName != value; _RecipientName = value; }
    }

    /// <summary>
    /// Property relating to database column RecipientType
    /// </summary>    
    public string RecipientType
    {
        get { return _RecipientType != null ? _RecipientType.TrimEnd() : string.Empty; }
        set { IsChanged |= _RecipientType != value; _RecipientType = value; }
    }

    /// <summary>
    /// Property relating to database column RecipientMobile
    /// </summary>    
    public string RecipientMobile
    {
        get { return _RecipientMobile != null ? _RecipientMobile.TrimEnd() : string.Empty; }
        set { IsChanged |= _RecipientMobile != value; _RecipientMobile = value; }
    }

    /// <summary>
    /// Property relating to database column RecipientSMS
    /// </summary>    
    public string RecipientSMS
    {
        get { return _RecipientSMS != null ? _RecipientSMS.TrimEnd() : string.Empty; }
        set { IsChanged |= _RecipientSMS != value; _RecipientSMS = value; }
    }

    /// <summary>
    /// Property relating to database column ResponceCode
    /// </summary>    
    public string ResponseCode
    {
        get { return _ResponseCode != null ? _ResponseCode.TrimEnd() : string.Empty; }
        set { IsChanged |= _ResponseCode != value; _ResponseCode = value; }
    }

    #endregion
  }
}
